unit FormMain;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, RzTabs, Vcl.Menus;

type
  TForm1 = class(TForm)
    mm1: TMainMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    Page_1: TRzPageControl;
    TabSheet1: TRzTabSheet;
    TabSheet2: TRzTabSheet;
    procedure N2Click(Sender: TObject);
    procedure FormResize(Sender: TObject);
  private
  public
  end;

var
  Form1: TForm1;

implementation

uses
  Form_ListUnit;

{$R *.dfm}

procedure TForm1.FormResize(Sender: TObject);
begin
  if TabSheet1.ControlCount>0 then
  begin
    TForm(TabSheet1.Controls[0]).WindowState :=  wsMaximized;
  end;
end;

procedure TForm1.N2Click(Sender: TObject);
var
  aView:TForm;
begin
  aView := TFormListUnit.Create(TabSheet1);
  AView.FormStyle:= fsNormal;
  aView.Parent := TabSheet1;
  aView.ManualDock(TabSheet1);
  aView.WindowState := wsMaximized;

  aView.BorderStyle := bsNone;
  aView.Show;
  aView.BringToFront;

  TabSheet1.Caption := aView.Caption;

  aView.Caption := '';
end;

end.
